#include <stdio.h>

//#可以使参数被替换为字面量而非其值
#define Print(n, format) printf("the value of " #n " is " format "\n", n)

//##可以把位于它两边的符号合成⼀个符号，它允许宏定义从分离的⽂本⽚段创建标识符
//相当于生成函数的函数
#define GENERIC_MAX(type) \
type type##_max(type x, type y) \
{ \
    return x > y ? x : y; \
}

GENERIC_MAX(int);
GENERIC_MAX(float);

int main()
{
    //printf("hello" "world\n");
    //printf("helloworld\n");
    //int a = 1;
    //Print(a, "%d");
    //printf("the value of a is %d\n", a);
    //int b = 20;
    //Print(b, "%d");
    //printf("the value of b is %d\n", b);
    //float f = 5.6f;
    //Print(f, "%f");
    //printf("the value of f is %f\n", f);

    int r1 = int_max(3, 5);
    printf("%d\n", r1);
    float r2 = float_max(3.1f, 4.5f);
    printf("%f\n", r2);

    return 0;
}